var time = 0;
var interval;

function init() {
	_initHeader();
	
	var array = new Array();
	
	array.push("setOnPause");
	array.push("setOnResume");
	array.push("setOnScreenTouch");
	array.push("setCustomizedBack");
	
	draw_list(array);
	
	interval = setInterval(setTime, 1000);
}

function setOnListClickHandler(idx) {
	switch(idx) {
		case 0 :
			testSetonPause();
		break;
		
		case 1 :
			testSetonResume();
		break;
		
		case 2 :
			testSetOnSrcreenTouch();
		break;
		
		case 3 :
			testSetCustomizedBack();
		break;
		
		default :
		break;
	}
}

function testSetonPause() {
	alopexController.setOnPause(pauseCallback);
	notifySuccess("setOnPause");
}

function testSetonResume() {
	alopexController.setOnResume(resumeCallback);
	notifySuccess("setOnResume");
}

function testSetOnSrcreenTouch() {
	alopexController.setOnScreenTouch(screenTouchCallback);
	notifySuccess("setOnSrcreenTouch");
}

function testSetCustomizedBack() {
	alopexController.setCustomizedBack(customizedBackCallback);
	notifySuccess("setCustomizedBack");
}

function pauseCallback() {
	alert("onPause수행 성공");
}

function resumeCallback() {
	alert("onResume수행 성공");
}

function screenTouchCallback() {
	log.log("onSrcreenTouch수행 성공");
	time = 0;
}

function customizedBackCallback() {
	alert("setCustomizedBack수행 성공");
}

function setTime() {
	$("#time").text(time++);
	
	if(time == 20) {
		alert("20 seconds time out");
		window.clearInterval(interval);
	}
}